Optimal. Leaf size=147 \[ -\frac {(B+i A) (c-i d) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (e+f x)}}{\sqrt {2} \sqrt {a}}\right )}{2 \sqrt {2} a^{3/2} f}+\frac {(-B+i A) (c+i d)}{3 f (a+i a \tan (e+f x))^{3/2}}+\frac {A (d+i c)+B (c+3 i d)}{2 a f \sqrt {a+i a \tan (e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.30, antiderivative size = 147, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3590, 3526, 3480, 206} \[ -\frac {(B+i A) (c-i d) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (e+f x)}}{\sqrt {2} \sqrt {a}}\right )}{2 \sqrt {2} a^{3/2} f}+\frac {(-B+i A) (c+i d)}{3 f (a+i a \tan (e+f x))^{3/2}}+\frac {A (d+i c)+B (c+3 i d)}{2 a f \sqrt {a+i a \tan (e+f x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 3480
Rule 3526
Rule 3590
Rubi steps
\begin {align*} \int \frac {(A+B \tan (e+f x)) (c+d \tan (e+f x))}{(a+i a \tan (e+f x))^{3/2}} \, dx &=\frac {(i A-B) (c+i d)}{3 f (a+i a \tan (e+f x))^{3/2}}-\frac {i \int \frac {a (B (c+i d)+A (i c+d))+2 a B d \tan (e+f x)}{\sqrt {a+i a \tan (e+f x)}} \, dx}{2 a^2}\\ &=\frac {(i A-B) (c+i d)}{3 f (a+i a \tan (e+f x))^{3/2}}+\frac {B (c+3 i d)+A (i c+d)}{2 a f \sqrt {a+i a \tan (e+f x)}}+\frac {((A-i B) (c-i d)) \int \sqrt {a+i a \tan (e+f x)} \, dx}{4 a^2}\\ &=\frac {(i A-B) (c+i d)}{3 f (a+i a \tan (e+f x))^{3/2}}+\frac {B (c+3 i d)+A (i c+d)}{2 a f \sqrt {a+i a \tan (e+f x)}}-\frac {(i (A-i B) (c-i d)) \operatorname {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (e+f x)}\right )}{2 a f}\\ &=-\frac {(i A+B) (c-i d) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (e+f x)}}{\sqrt {2} \sqrt {a}}\right )}{2 \sqrt {2} a^{3/2} f}+\frac {(i A-B) (c+i d)}{3 f (a+i a \tan (e+f x))^{3/2}}+\frac {B (c+3 i d)+A (i c+d)}{2 a f \sqrt {a+i a \tan (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 5.44, size = 206, normalized size = 1.40 \[ \frac {(A+B \tan (e+f x)) (c+d \tan (e+f x)) \left (\frac {2}{3} \cos (e+f x) ((A (d+5 i c)+B (c+7 i d)) \cos (e+f x)-3 (A c-i A d-i B c+3 B d) \sin (e+f x))-i (A-i B) (c-i d) e^{i (e+f x)} \sqrt {1+e^{2 i (e+f x)}} \sinh ^{-1}\left (e^{i (e+f x)}\right )\right )}{4 f (a+i a \tan (e+f x))^{3/2} (A \cos (e+f x)+B \sin (e+f x)) (c \cos (e+f x)+d \sin (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.82, size = 625, normalized size = 4.25 \[ -\frac {{\left (3 \, \sqrt {\frac {1}{2}} a^{2} f \sqrt {-\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} c^{2} - {\left (2 i \, A^{2} + 4 \, A B - 2 i \, B^{2}\right )} c d - {\left (A^{2} - 2 i \, A B - B^{2}\right )} d^{2}}{a^{3} f^{2}}} e^{\left (3 i \, f x + 3 i \, e\right )} \log \left (-\frac {{\left (\sqrt {2} \sqrt {\frac {1}{2}} {\left (4 i \, a^{2} f e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, a^{2} f\right )} \sqrt {\frac {a}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} c^{2} - {\left (2 i \, A^{2} + 4 \, A B - 2 i \, B^{2}\right )} c d - {\left (A^{2} - 2 i \, A B - B^{2}\right )} d^{2}}{a^{3} f^{2}}} - {\left (4 \, {\left (A - i \, B\right )} a c - {\left (4 i \, A + 4 \, B\right )} a d\right )} e^{\left (i \, f x + i \, e\right )}\right )} e^{\left (-i \, f x - i \, e\right )}}{{\left (A - i \, B\right )} c - {\left (i \, A + B\right )} d}\right ) - 3 \, \sqrt {\frac {1}{2}} a^{2} f \sqrt {-\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} c^{2} - {\left (2 i \, A^{2} + 4 \, A B - 2 i \, B^{2}\right )} c d - {\left (A^{2} - 2 i \, A B - B^{2}\right )} d^{2}}{a^{3} f^{2}}} e^{\left (3 i \, f x + 3 i \, e\right )} \log \left (-\frac {{\left (\sqrt {2} \sqrt {\frac {1}{2}} {\left (-4 i \, a^{2} f e^{\left (2 i \, f x + 2 i \, e\right )} - 4 i \, a^{2} f\right )} \sqrt {\frac {a}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {-\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} c^{2} - {\left (2 i \, A^{2} + 4 \, A B - 2 i \, B^{2}\right )} c d - {\left (A^{2} - 2 i \, A B - B^{2}\right )} d^{2}}{a^{3} f^{2}}} - {\left (4 \, {\left (A - i \, B\right )} a c - {\left (4 i \, A + 4 \, B\right )} a d\right )} e^{\left (i \, f x + i \, e\right )}\right )} e^{\left (-i \, f x - i \, e\right )}}{{\left (A - i \, B\right )} c - {\left (i \, A + B\right )} d}\right ) - \sqrt {2} {\left ({\left (i \, A - B\right )} c - {\left (A + i \, B\right )} d + {\left ({\left (4 i \, A + 2 \, B\right )} c + 2 \, {\left (A + 4 i \, B\right )} d\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left ({\left (5 i \, A + B\right )} c + {\left (A + 7 i \, B\right )} d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}}\right )} e^{\left (-3 i \, f x - 3 i \, e\right )}}{12 \, a^{2} f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (B \tan \left (f x + e\right ) + A\right )} {\left (d \tan \left (f x + e\right ) + c\right )}}{{\left (i \, a \tan \left (f x + e\right ) + a\right )}^{\frac {3}{2}}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.27, size = 131, normalized size = 0.89 \[ -\frac {2 i \left (-\frac {\left (\frac {1}{4} i A d +\frac {1}{4} i B c -\frac {1}{4} c A +\frac {1}{4} B d \right ) \sqrt {2}\, \arctanh \left (\frac {\sqrt {a +i a \tan \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2 \sqrt {a}}-\frac {-\frac {1}{4} i A d -\frac {1}{4} i B c +\frac {1}{4} c A +\frac {3}{4} B d}{\sqrt {a +i a \tan \left (f x +e \right )}}-\frac {a \left (i A d +i B c +c A -B d \right )}{6 \left (a +i a \tan \left (f x +e \right )\right )^{\frac {3}{2}}}\right )}{f a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.64, size = 143, normalized size = 0.97 \[ \frac {i \, {\left (\frac {3 \, \sqrt {2} {\left (A - i \, B\right )} {\left (c - i \, d\right )} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (f x + e\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (f x + e\right ) + a}}\right )}{\sqrt {a}} + \frac {4 \, {\left (2 \, {\left (A + i \, B\right )} a c - {\left (-2 i \, A + 2 \, B\right )} a d + {\left (3 \, {\left (A - i \, B\right )} c - {\left (3 i \, A - 9 \, B\right )} d\right )} {\left (i \, a \tan \left (f x + e\right ) + a\right )}\right )}}{{\left (i \, a \tan \left (f x + e\right ) + a\right )}^{\frac {3}{2}}}\right )}}{24 \, a f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 10.27, size = 245, normalized size = 1.67 \[ \frac {\frac {\left (A\,c+A\,d\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{3\,f}+\frac {\left (A\,c-A\,d\,1{}\mathrm {i}\right )\,\left (a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,a\,f}}{{\left (a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{3/2}}-\frac {\frac {B\,c+B\,d\,1{}\mathrm {i}}{3\,f}-\frac {\left (B\,c+B\,d\,3{}\mathrm {i}\right )\,\left (a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}{2\,a\,f}}{{\left (a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^{3/2}}+\frac {\sqrt {2}\,B\,\mathrm {atanh}\left (\frac {\sqrt {2}\,B\,\left (d+c\,1{}\mathrm {i}\right )\,\sqrt {a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-a}\,\left (B\,c-B\,d\,1{}\mathrm {i}\right )}\right )\,\left (d+c\,1{}\mathrm {i}\right )}{4\,{\left (-a\right )}^{3/2}\,f}+\frac {\sqrt {2}\,A\,\mathrm {atan}\left (\frac {\sqrt {2}\,A\,\left (d+c\,1{}\mathrm {i}\right )\,\sqrt {a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {a}\,\left (A\,c-A\,d\,1{}\mathrm {i}\right )}\right )\,\left (d+c\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4\,a^{3/2}\,f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (A + B \tan {\left (e + f x \right )}\right ) \left (c + d \tan {\left (e + f x \right )}\right )}{\left (i a \left (\tan {\left (e + f x \right )} - i\right )\right )^{\frac {3}{2}}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________